#pragma once
#include "Shader.h"

namespace Graphics
{
class ClipPlaneShader : public Shader
{
	RTTI_DECLARATIONS(ClipPlaneShader, Graphics::Shader)
private:
	struct ClipPlaneBufferType
	{
		D3DXVECTOR4 clipPlane;
	};

public:
	ClipPlaneShader(void);
	
	virtual ~ClipPlaneShader(void);

	bool Initialize();

	void Deinitialize();

	bool Render(int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix, ID3D11ShaderResourceView* texture, D3DXVECTOR4 clipPlane);

private:
	bool InitializeShader(HWND winHandle, const char* vertexShaderName, const char*  pixelShaderName);

	void DeinitializeShader();

	bool SetShaderParameters(D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix, ID3D11ShaderResourceView* texture, D3DXVECTOR4 clipPlane);

private:
	ID3D11Buffer* mClipPlaneBuffer;
};
}